//
//  ZYRect.m
//  Example
//
//  Created by wzp on 2024/8/17.
//

#import "ZYRect.h"
@interface ZYRect()
@property (nonatomic, assign) CGPoint point;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@end

@implementation ZYRect
- (instancetype)initWithPoint:(CGPoint)point
                        width:(CGFloat)width
                       height:(CGFloat)height
{
    if (self = [super init]) {
        self.point = point;
        self.width = width;
        self.height = height;
    }
    return self;
}

- (void)drawInContextRef:(CGContextRef)ref color:(UIColor *)color
{
    [color setStroke];
    CGContextMoveToPoint(ref, self.point.x, self.point.y);
    CGContextAddRect(ref, CGRectMake(_point.x, _point.y, _width, _height));
    CGContextSetLineWidth(ref, 1.0f);
    CGContextStrokePath(ref);
}
@end
